<?php

include_once(DAO_PATH . "/ComponentDAO.php");
include_once("UCController.php");

class UCDeleteComponent implements UCController
{
	function run()
	{
		// objects to be utilised during this use case
		$dao = new ComponentDAO();

		// get the variables from the php POST method
                $componentId = $_REQUEST['component'];

		// send the new component to the dao process the result
		$result= $dao->deleteComponent($componentId);
		if ($result == true)
		{
			echo "Component has been successfully delete";
		}
		else
		{
			echo "Error detected, the operation was unsuccessful";
		}
	}
}

?>